package com.nbgs.demo.controller;


import com.nbgs.demo.common.Result;
import com.nbgs.demo.controller.form.InsertConsumptionInfoForm;
import com.nbgs.demo.service.InsertConsumptionInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin("*")
@RestController
@Slf4j
@Api(tags = "抄表员每次提交用水信息的接口", description = "录入抄水信息")
public class InputWaterInformationController {

    @Autowired
    private InsertConsumptionInfoService insertConsumptionInfoService;


    @PostMapping("inputConsumptionInfo")
    @ApiOperation("进行自动生成的用水信息的完善，生成一条完整地用水信息数据")
    private Result inputInfo(@RequestBody InsertConsumptionInfoForm insertInfo){
    log.info("传进来的数据："+insertInfo.toString());
        insertConsumptionInfoService.InsertConsumptionInfo(insertInfo);
        return Result.success(true);
    }


}
